/* author: Mariana Horita
   mariana.horita@gmail.com
   file: A5E4-p1.aspx.cs*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Exercicios
{
    public partial class A5E4_p1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Cadastro"] != null)
            {
                Cadastro c = (Cadastro)Session["Cadastro"];

                txtNome.Text = c.Nome;
                txtTelefone.Text = c.Telefone;
                txtEndereco.Text = c.Endereco;
            }
        }

        protected void btEnviar_Click(object sender, EventArgs e)
        {
            Cadastro c = new Cadastro();
            c.Nome = txtNome.Text;
            c.Telefone = txtTelefone.Text;
            c.Endereco = txtEndereco.Text;

            Session["Cadastro"] = c;

            Response.Redirect("A5E4-p2.aspx?");
        }
    }
}